package com.codi.bus.core.service;

import com.codi.bus.core.domain.User;
import com.codi.bus.core.resultModel.*;
import com.codi.bus.core.service.model.*;

import java.util.List;

/**
 * @author lvgo
 * @version 4.5.0
 * @Description: 交易记录
 * @date 2018/4/9 11:03
 */
public interface ApplyRecordService {

    /**
     * 资产--组合的交易记录
     *
     * @param portfolioCode 组合代码 非必
     * @param queryType     业务类型, all 全部 onWay 进行中
     * @param userId        用户id
     * @param business      业务代码
     * @return
     */
    PTradingRecordListResult queryPortfolioRecord(String portfolioCode, String queryType, Long userId, Integer beginNum, Integer requestNum, String business, String portfolioAllotNo);

    /**
     * 资产--基金的交易记录
     *
     * @param fundCode  基金代码 非必
     * @param queryType 业务类型, all 全部 onWay 进行中
     * @param userId    用户id
     * @param business  业务代码
     * @param allotNo   交易单号
     * @return
     */
    NTradingRecordListResult queryFundRecord(String fundCode, String queryType, Long userId, Integer beginNum, Integer requestNum, String business, String allotNo);

    /**
     * 资产--瑞富宝的交易记录
     *
     * @param fundCode  基金代码 非必
     * @param queryType 业务类型, all 全部 onWay 进行中
     * @param userId    用户id
     * @param business  业务代码
     * @return
     */
    WTradingRecordListResult queryRuifubaoRecord(String fundCode, String queryType, Long userId, Integer beginNum, Integer requestNum, String business, String allotNo);

    /**
     * 基金详情
     *
     * @param allotNo 交易编号
     * @param userId  用户id
     */
    BaseResult queryFundDetail(Long userId, String allotNo);

    /**
     * 获取分类 - 交易类型
     *
     * @return
     */
    List<DealType> getType();

    List<DividendModel> getPortfolioDividendApply(User user, String taSerialId);

    List<ApplyModel> getNormalCodeApplys(List<ApplyModel> applys, String normalCode);

    List<DividendModel> getNormalDividendApplys(String fundCode, User user, String taSerialId);

    List<DividendModel> getWalletDividendApplys(User user, String taSerialId);

    void filterFund(List<DividendModel> dividendModels, boolean filterT0);

    void normalFilterT0(List<ApplyModel> applys, boolean filterT0);

    void dividendFilterT0(List<DividendModel> dividendModels, boolean filterT0);

    List<PortfolioApplyModel> getIntradingApplys(List<PortfolioApplyModel> portfolioApplyModels);

    List<ApplyModel> getNormalIntradingApplys(List<ApplyModel> applys);

    List<PortfolioApplyModel> getPortfolioCodeApplys(List<PortfolioApplyModel> portfolioApplys, String portfolioCode);

    List<PortfolioApplyModel> busniessData(List<PortfolioApplyModel> portfolioApplyModels, String busniess);

    List<ApplyModel> normalBusniessData(List<ApplyModel> applys, String busniess);

    void filtrate(BaseListResult result, List<PTradingRecord> pTradingRecords, List<PTradingRecord> pTradingRecordReal, Integer beginNum, Integer requestNum);

    void filtrateFunds(BaseListResult result, List<NTradingRecord> nTradingRecords, List<NTradingRecord> nTradingRecordReal, Integer beginNum, Integer requestNum);

    void filtrateWallet(BaseListResult result, List<WTradingRecord> wTradingRecords, List<WTradingRecord> wTradingRecordReal, Integer beginNum, Integer requestNum);

    String businessCode(String business);
}
